<?php
/**
 * Pipahr
 *
 * @author Randy Zhao
 * @copyright 2013 pipahr.com
 */
$l=OC_L10N::get('calendar');
$user = PFactory::getUser();

if(isset($user->cb_usertype) && $user->cb_usertype == 'jobseeker'){
   return;
}

OCP\App::addNavigationEntry( array(
   "id" => "calendar_index",
   "order" => 3,
   "href" => OCP\Util::linkToRoute("calendar_home"),
   "class" => "hr_i_calendar",
   "name" => "面试管理"
));

/* link to joomla framework */
require_once(OC::$SERVERROOT.'/apps/joomla/application.php');

JLoader::import('joomla.application.component.model', JPATH_LIBRARIES);
JLoader::register("CensorHelper", JPATH_SITE.'/components/com_censor/helper.php');
JLoader::register("CompanyHelper", JPATH_SITE.'/components/com_company/helper.php');
JLoader::register("UserPrivacy", JPATH_SITE.'/components/com_puser/userprivacy.php');
JLoader::register('PCalendarHelper', OC::$SERVERROOT."/apps/calendar/lib/helper.php");
JLoader::register("PResumesHelper", OC::$SERVERROOT."/apps/resumes/lib/helper.php");
JLoader::register("PCompanyHelper", OC::$SERVERROOT."/apps/company/lib/helper.php");

// init pipapai application
PFactory::init();

//General Hooks
OCP\Util::connectHook('OC_User', 'post_createMasterUser', 'OC_Calendar_Hooks', 'createUser');
OCP\Util::connectHook('OC_User', 'post_createUser', 'OC_Calendar_Hooks', 'createUser');
OCP\Util::connectHook('OC_User', 'post_deleteUser', 'OC_Calendar_Hooks', 'deleteUser');

OCP\Share::registerBackend('calendar', 'OC_Share_Backend_Calendar');
OCP\Share::registerBackend('event', 'OC_Share_Backend_Event');
OCP\Share::registerBackend('offer', 'OC_Share_Backend_Offer');

